home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PCTV3N3 / PUSHPOP.H < prev    next >
Text File  |  1992-01-10  |  596b  |  24 lines

  1. #include <stddef.h>
  2.  
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6.  
  7. void pascal va_push(void);
  8. void pascal va_pop(size_t stksize);
  9.  
  10. #ifdef __cplusplus
  11. };
  12. #endif
  13.  
  14. /* Convert va_push(void) to va_push(type value). */
  15. #define va_push(type, value)  \
  16.   ((*((void pascal (*)(type))va_push))(value))
  17.  
  18. /* Depth of stack popped is n * sizeof(type) + sizeof(size_t);
  19. type    is word-aligned on stack and extra size_t is for
  20. parameter to    va_pop() itself. */
  21. #define va_pop(type, n)  \
  22.   (va_pop((size_t)((sizeof(type) + 1) & 0xFFFE) *  \
  23.           (size_t)(n) + (size_t)sizeof(size_t)))
  24.